package serviceImpl;

import java.util.ArrayList;

import dao.BackCollegeDao;
import dao.BackForumDao;
import daoImpl.BackCollegeDaoImpl;
import daoImpl.BackForumDaoImpl;
import pojo.Question;
import service.BackForumService;

public class BackForumServiceImpl implements BackForumService{

	@Override
	public ArrayList<Question> getQuestion() {
		BackForumDao  bfd = new BackForumDaoImpl();
		ArrayList<Question> qList = bfd.getQuestion();
		return qList;
	}

	@Override
	public boolean addQuestion(String qTitle, String qContent, int userid) {
		BackForumDao  bfd = new BackForumDaoImpl();
		int row = bfd.addQuestion(qTitle,qContent,userid);
		return row>0 ? true : false;
	}

	@Override
	public boolean delQuestion(int qid) {
		BackForumDao  bfd = new BackForumDaoImpl();
		int row = bfd.delQuestion(qid);
		return row>0 ? true : false;
	}

}
